<!--
    Copyright (C) 2006-2007 Orbeon, Inc.

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.

    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<!--
    This is a very simple theme that shows you how to create a common layout for all your pages. You can modify it at
    will or, even better, copy it as theme-[yourapp].xsl and refer to the new name from the epilogue pipeline.
-->
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:version="java:org.orbeon.oxf.common.Version">

	<!-- Orbeon Forms version -->
	<xsl:variable name="orbeon-forms-version" select="version:getVersion()" as="xs:string"/>

	<!-- - - - - - - Themed page template - - - - - - -->
	<xsl:template match="/*">
		<xsl:copy>
			<xsl:copy-of select="@*"/>
			<xhtml:head>

				<xhtml:link rel="stylesheet" type="text/css" href="/views/css/common.css" />
				<xhtml:link rel="stylesheet" type="text/css" href="/views/css/forms.css" />
				<xhtml:link rel="stylesheet" type="text/css" href="/views/css/login.css" />
				<xhtml:link rel="stylesheet" type="text/css" href="/views/css/register.css" />
				<xhtml:link rel="stylesheet" type="text/css" href="/views/css/autocomplete.css" />
				<xhtml:link rel="stylesheet" type="text/css" href="/views/css/thickbox.css" />
				<xhtml:link rel="stylesheet" type="text/css" href="/views/css/widget.css" />

				<!-- Standard scripts/styles -->
				<!-- NOTE: The XForms engine may place additional scripts and stylesheets here as needed -->
				<!-- Handle head elements -->
				<xsl:for-each select="/xhtml:html/xhtml:head/(xhtml:meta | xhtml:link | xhtml:style | xhtml:script)">
					<xsl:element name="xhtml:{local-name()}" namespace="{namespace-uri()}">
						<xsl:copy-of select="@*"/>
						<xsl:apply-templates/>
					</xsl:element>

				</xsl:for-each>
				<!--<xhtml:link rel="stylesheet" type="text/css" href="/views/login/fix-ie7.css" />-->
				<!-- Title -->
				<xhtml:title>
					<xsl:choose>
						<xsl:when test="/xhtml:html/xhtml:head/xhtml:title != ''">
							<xsl:value-of select="/xhtml:html/xhtml:head/xhtml:title"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="(/xhtml:html/xhtml:body/xhtml:h1)[1]"/>
						</xsl:otherwise>
					</xsl:choose>
				</xhtml:title>
				<!-- Orbeon Forms version -->
				<xhtml:meta name="generator" content="Orbeon Forms {$orbeon-forms-version}"/>
			</xhtml:head>
			<xhtml:body>
				<!-- Copy body attributes -->
				<xsl:apply-templates select="/xhtml:html/xhtml:body/@*"/>
				<!-- Copy body -->
				<xsl:apply-templates select="/xhtml:html/xhtml:body/node()"/>
				<!--Create footer-->
				<xhtml:div id="footer">
					<xhtml:a href="http://palette.ercim.org">
						<xhtml:img class="footer_logo" src="/views/img/logo.png" alt="PALETTE is an Integrated Project supported by the IST programme of the European Commission" title="PALETTE is an Integrated Project supported by the IST programme of the European Commission"/>
					</xhtml:a>
					<xhtml:a href="http://europa.eu">
						<xhtml:img class="footer_logo" src="/views/img/footer-eu.png" alt="PALETTE is an Integrated Project supported by the IST programme of the European Commission" title="PALETTE is an Integrated Project supported by the IST programme of the European Commission"/>
					</xhtml:a>
					<xhtml:a href="http://www.tudor.lu">
						<xhtml:img class="footer_logo" src="/views/img/footer-tudor.png" alt="Public Research Center Henri Tudor" title="Centre de Recherche Public Henri Tudor"/>
					</xhtml:a>
					<!--<xhtml:a href="http://www.epfl.ch">
						<xhtml:img class="footer_logo" src="/config/EPFL-logo.png" alt="Ecole Polytechnique F&#233;d&#233;rale de Lausanne" title="Ecole Polytechnique F&#233;d&#233;rale de Lausanne"/>
					</xhtml:a>-->
					<xhtml:p>Copyright 2007-<xsl:value-of select="year-from-date(current-date())"/> EPFL.<xhtml:br/>Copyright 2007-2008 Public Research Center Henri Tudor.</xhtml:p>
				</xhtml:div>
			</xhtml:body>
		</xsl:copy>
	</xsl:template>

	<!-- Simply copy everything that's not matched -->
	<xsl:template match="@*|node()" priority="-2">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
		</xsl:copy>
	</xsl:template>

</xsl:stylesheet>
